﻿using ResxHelper.Logic;
using ResxHelper.Object;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ResxHelper.Forms
{
    public partial class FrmExportMultipleOptions : Form
    {
        public ExportMultipleOption Option;
        public ResourceType Format;

        public FrmExportMultipleOptions()
        {
            InitializeComponent();
        }

        public FrmExportMultipleOptions(ExportMultipleOption option) : this()
        {
            Option = option;
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            if (cboExportOption.Text == "")
            {
                MessageBox.Show("Please choose an export option!");
                return;
            }
            switch (cboExportOption.Text)
            {
                case "Files Only":
                    Option = ExportMultipleOption.FilesOnly;
                    break;
                case "Files w/Zip":
                    Option = ExportMultipleOption.FilesAndZip;
                    break;
                case "Zip Only":
                    Option = ExportMultipleOption.ZipOnly;
                    break;
            }

            if (cboFormat.Text == "")
            {
                MessageBox.Show("Please choose an export format!");
                return;
            }
            switch (cboFormat.Text)
            {
                case "Comma Delimited Text (*.csv)":
                    Format = ResourceType.Csv;
                    break;
                case "Excel File (*.xls)":
                    Format = ResourceType.Excel;
                    break;
                case "Resource File (*.resx)":
                    Format = ResourceType.Resx;
                    break;
            }

            Hide();
        }
    }
}
